
#include <BChannel>
#include "member_BChannel.h"
#include "member_BAnimation.h"

using namespace BWE;

#define member					(*(member_BChannel*)_ptr)
#define member_allocate()		_ptr = new member_BChannel(this)
#define member_release()		delete (member_BChannel*)_ptr

BChannel::BChannel()
{
	member_allocate();
}
BChannel::~BChannel()
{
	member_release();
}

void BChannel::setLerp(Lerp lerp)
{
	if (member.lerp != lerp)
	{
		member.lerp = lerp;
		member.freshSampler();
	}
}
Lerp BChannel::lerp() const
{
	return member.lerp;
}

void BChannel::setTargetName(const BString& targetName)
{
	if (member.targetName != targetName)
	{
		member.targetName = targetName;
		member.target = 0;
		if (member.animation)
		{
			animation_member(member.animation)->linkChannel(this);
		}
	}
}
const BString& BChannel::targetName() const
{
	return member.targetName;
}
BObject* BChannel::target()
{
	return member.target;
}

